var express = require("express");
var cors = require("cors");

//HTTP请求体解析中间件
var bodyParser = require("body-parser");

var app = express();
app.use(cors());
var router = require("./router");
app.use(bodyParser.urlencoded({extended: false}));
app.use(bodyParser.json())
app.use("/", router);

var server = app.listen(9000,"0.0.0.0", function () {
    var {port} = server.address();
    console.log("HTTP启动成功：http://localhost:%s", port);
})